﻿using System;
using System.Collections.Generic;
using System.Data;
using DBAccessLibrary.Model;

namespace DBAccessLibrary.Interface
{
    public interface ISqlGrammar
    {
        string AddColumn(DBType type,FieldEntity filed);
        string EditColumn(ConnectionModel connect, FieldEntity filed);
        string RemoveColumn(ConnectionModel connect, FieldEntity field);

        string SelectTop(DBType type, TableEntity table, int count);
        string SelectAll(DBType type, TableEntity table);
        string GetChTableSql(DBType type);
        string IsExistChTableSql(DBType type);
        string AppendTabText(string text);
        string GetErrorInfo(string errorMsg);
        string GetProcParamInfo(DBType type, ProcEntity entity);
        string GetCreateInfo(DBType targetType,TableEntity entity);

        string EditPrimary(ConnectionModel connect, TableEntity table, string[] parimaryKey);
        bool GetExecProcInfo(string sql, DBType type, out string procName, out List<DBParam> paramlist);


        string GetDataSetToInsertSql(string sql, DataSet ds, Func<string, bool?> dbTypeAction, out string tableName);
        string GetPageingSql(DBType type, string sql, decimal index, decimal count);
    }
}
